package com.my12306.train.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.my12306.common.model.vo.PageVo;
import com.my12306.train.model.entity.CarriageEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 车厢表
 *
 * @author ËÕÄÁÏ¦
 * @email
 * @date 2020-07-24 20:58:07
 */
@Mapper
public interface CarriageDao extends BaseMapper<CarriageEntity> {
    /**
     * 分页查询
     *
     * @param pageVo
     * @param logicDelete
     * @return
     */
    List<CarriageEntity> queryCarriagePage(@Param("pageVo") PageVo pageVo, @Param("logicDelete") int logicDelete);

    /**
     * 分页查询总数
     *
     * @param pageVo
     * @param logicDelete
     * @return
     */
    Integer queryCarriageCount(PageVo pageVo, Integer logicDelete);

    /**
     * 根据ids批量删除车厢
     *
     * @param carriageIds
     * @param logicDelete
     */
    void deleteCarriageBatchByIds(@Param("list") List<Long> carriageIds, @Param("logicDelete") Integer logicDelete);

    /**
     * 根据车次查询所有的车厢(即票种)
     * @param trainCode
     * @param logicDelete
     * @return
     */
    List<CarriageEntity> queryAllCarriageByTrainCode(@Param("trainCode") String trainCode, @Param("logicDelete") Integer logicDelete);
}
